From: Jonas Dreßler Date: Sun, 29 Apr 2018 23:06:35 +0000 (+0200) Subject: altTab: Use this._highlighted instead of this._curApp in AppSwitcher X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~530^2^2~252 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=7ae694990b871dbb3407ac974220ff182c56f386;p=gnome-shell.git altTab: Use this._highlighted instead of this._curApp in AppSwitcher Thanks to the parent class (SwitcherPopup), we already have a property for the currently highlighted item, let's use it. Part-of: --- diff --git a/js/ui/altTab.js b/js/ui/altTab.js index dacd9bec6..c03c680c3 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -706,7 +706,6 @@ class AppSwitcher extends SwitcherPopup.SwitcherList { this._addIcon(appIcon); } - this._curApp = -1; this._altTabPopup = altTabPopup; this._mouseTimeOutId = 0; @@ -829,21 +828,20 @@ class AppSwitcher extends SwitcherPopup.SwitcherList { // show a dim arrow, but show a bright arrow when they are // highlighted. highlight(n, justOutline) { - if (this.icons[this._curApp]) { - if (this.icons[this._curApp].cachedWindows.length == 1) - this._arrows[this._curApp].hide(); + if (this.icons[this._highlighted]) { + if (this.icons[this._highlighted].cachedWindows.length === 1) + this._arrows[this._highlighted].hide(); else - this._arrows[this._curApp].remove_style_pseudo_class('highlighted'); + this._arrows[this._highlighted].remove_style_pseudo_class('highlighted'); } super.highlight(n, justOutline); - this._curApp = n; - if (this._curApp != -1) { - if (justOutline && this.icons[this._curApp].cachedWindows.length == 1) - this._arrows[this._curApp].show(); + if (this._highlighted !== -1) { + if (justOutline && this.icons[this._highlighted].cachedWindows.length === 1) + this._arrows[this._highlighted].show(); else - this._arrows[this._curApp].add_style_pseudo_class('highlighted'); + this._arrows[this._highlighted].add_style_pseudo_class('highlighted'); } }